Replication Code for "Systemic Discrimination Among Large U.S. Employers"
Patrick M. Kline, Evan K. Rose, Christopher R. Walters
May, 2022

The archive contains complete code necessary to replicate all main and appendix
Figures and Tables in the published version of the paper. 

The primary dataset is contained in /data. Most analyses require no additional
data to be run. The data in /covariates has been excluded to prevent identification
of individual firms in the study, however. This affects replication of Figures
4, 5, and 9. 

Some code, such as main_effect_estimates.do, produces several tables and figures. 
Other code, such as table5.do, produces a table or figure directly. Some code,
such as variance_estimates.do, produces inputs to several tables. The formatted
output in the paper can be obtained by copying the output of the code listed
below into the second tab of the spreadsheet with the table name in /tables.

All tables and figures are saved using their name in the published paper (e.g.,
Figure 1, Table 1).

All code was executed on a 64-bit Linux machine, using R version 4.1.2, Matlab 
R2022a, and Stata-MP 16.0.

The tables and figures in the main text of the paper are produced by the
following code:

Main Tables:
	- Table 1: main_effect_estimates.do
	- Table 2: main_effect_estimates.do
	- Table 3: main_effect_estimates.do
	- Table 4: variance_estimates.do
	- Table 5: table5.do
	- Table 6: variance_estimates.do
	- Table 7: table7prep.do, table7a.m, table7b.R
	- Table 8: table8prep.R, table8.R
	- Table 9: deconvolve.R
	- Table 10: deconvolve.R

Main Figures:
	- Figure 1: No code required
	- Figure 2: main_effect_estimates.do
	- Figure 3: covariates.do
	- Figure 4: covariates.do
	- Figure 5: covariates.do
	- Figure 6: deconvolve.R
	- Figure 7: deconvolve.R, with standard errors procued by deconvolve_bs.R
	- Figure 8: deconvolve.R
	- Figure 9: covariates.do, with csv input from deconvolve.R
	- Figure 10: deconvolve.R
	- Figure 11: deconvolve.R	
	- Figure 12: figure12.R

Appendix Tables
	- Table A1: variance_estimates.do
	- Table A2: variance_estimates.do
	- Table A3: tableA3.do
	- Table A4: tableA4.do
	- Table B1: No code required
	- Table B2: No code required
	- Table C1: covriates.do
	- Table C2: covaariates.do

Appendix Figures
	- Figure A1: No code required
	- Figure A2: main_effect_estimates.do
	- Figure A3: figureA3-A4.R
	- Figure A4: figureA3-A4.R
	- Figure A5: main_effect_estimates.do
	- Figure A6: main_effect_estimates.do
	- Figure A7: covariates.do
	- Figure A8: covariates.do
	- Figure A9: covariates.do
	- Figure A10: deconvolve.R
	- Figure A11: deconvolve.R
	- Figure A12: figureA12.R
	- Figure A13: figureA13.R
	- Figure A14: deconvolve.R
	- Figure A15: deconvolve.R
	- Figure E1: figureE1-E2.R
	- Figure E2: figureE1-E2.R
	- Figure E3: figureE3.R
	- Figure E4: figureE4-6.R
	- Figure E5: figureE4-6.R
	- Figure E6: figureE4-6.R
	- Figure E7: figureE7-8.R
	- Figure E8: figureE7-8.R



